package ink.lovejinhu.leetcode;

/**
 * @author jinhu
 * created 2021-07-12 11:31
 */
public class Solution_0326 {
    /**
     * 3的幂
     *
     * @param n
     * @return
     */
    public boolean isPowerOfThree(int n) {
        while (n > 1 && n % 3 == 0) {
            n = n / 3;
        }

        return n == 1;
    }
}
